<template>
	<view class="container">
		<view class="" style="margin: 30rpx;color: #9c9c9c;display: flex; align-items: center;justify-content: space-around;">
			<text>患者姓名：{{title.xm}}</text> 
			<text>性别：{{title.xb}}</text>
			<text>年龄：{{title.nl}}</text>
		</view>
		<uni-steps v-if="list2.length" :options="list2" :active="active" direction="column" />
		<view class="no-data" v-else style="text-align: center;">
			<image src="../../static/icons/nodata.png" style="width: 150rpx;" mode="widthFix"></image>
			<text>暂无护理记录</text>
		</view>
	</view>
</template>

<script>
	import { nursingById } from '../../api/huanzhe.js'
	export default {
		data() {
			return {
				active: -1,
				list2: [],
				title:{
					xm:null,
					xb:null,
					nl:null
				}
			};
		},
		onLoad(option){
			var query=JSON.parse(option.data)
			this.title.xm=query.xm
			this.title.xb=query.xb
			this.title.nl=query.nl
			this.nursingByIds(query.hzId)
		},
		methods:{
			// 根据患者id查询
			nursingByIds(hzId){
				nursingById(hzId).then(res=>{
					res.rows.forEach((item,index)=>{
						var list={
							title:'处置医生:'+item.username,
							desc: '呼吸：'+item.hx+
							'\n体温：'+item.tw+
							'\n脉搏：'+item.mb+
							'\n血压：'+item.xy+
							'\n神智：'+item.sz+
							'\n性质：'+item.xz+
							'\n血压：'+item.xy+
							'\n输入量：'+item.srl+
							'\n输出量：'+item.scl+
							'\n备注：'+item.bz
						}
						this.list2.push(list)
					})
				})
			}
		}
	}
</script>

<style lang="scss">
.no-data {
			position: absolute;
			top: 0rpx;
			left: 0;
			right: 0;
			bottom: 0;
			color: #333333;
			width: 100%;
			z-index: 1;
			display: flex;
			align-items: center;
			justify-content: center;
			flex-direction: column;
		}
</style>